Current Internet Protocol (IP) networks may comprise a plurality of nodes, including a plurality of routers at the core of the network and a plurality of hosts at the edge of the network. The routers collectively link the communication channels between hosts. The nodes are assigned network-wide unique IP addresses to enable proper and efficient traffic forwarding to destination nodes. The routers may route packets in the IP networks based on the IP addresses carried in the packets. The packets may be forwarded by the routers to proper destinations based on a <source address, destination address> pair, which may be indicated in each packet.
Many high-speed packet switching networks use lookup operations to match a value or a set of values against a table of entries. For example, IP routing operations commonly apply longest prefix match (LPM) comparison techniques to perform forwarding table look-ups. Thus, the routers may utilize data structures such as forwarding tables to perform one or more lookup operations on packets. Upon receiving a packet, a router may refer to a forwarding table and use a network address (e.g., an IP address prefix) of the received packet as a key. For instance, the router may use the forwarding table to look up a packet's destination address and select an output port associated with that address. If a match is not found, then the packet may be flooded (e.g., forwarded over various ports) or discarded.
Lookup and update operations are commonly used with hash tables in which data values are indexed based on the result of a hash function that may be applied to the corresponding keys for the data values. Application of the hash function generates an index to a location or “bucket” of the hash table. Each bucket of the hash table may include a fixed number of entries for storing data values with keys that “hash” to the same index. The keys and data values may be stored in and retrieved from the bucket corresponding with the index produced by applying the hash function to the key.
One benefit of using a data structure such as a hash table is that the lookup time to locate a value associated with a key is generally constant regardless of the number of data values in the hash table. Therefore, a hash table implementation may remain efficient even when the number of data values stored in the buckets becomes considerably large. On the other hand, an issue that commonly arises when using hash functions with lookup tables is that collisions are practically unavoidable. A collision may occur when a hash function produces the same index for two or more distinct keys, in which case an attempt to insert a data item in the same location as an existing item value might be blocked. Thus, unlike fully-associative data structures such as content addressable memories (CAMs), conventional hash tables may not guarantee deterministic lookups.
Therefore, one or more techniques might be needed to resolve collisions so that a unique index can be generated from each key (e.g., packet address). One technique used in such cases involves linking each position or slot of the bucket to a list containing the key-value pairs hashed to the same location. Another technique includes increasing the size of each bucket to accommodate multiple data values. However, such techniques are known to be costly in terms of memory bandwidth requirements and processing time. Additionally, many of these techniques utilize special circuitry known to be relatively expensive and complicated.